<template>
<div>
  <V-CommonHeaderLeft>
     <div id="app">
    <el-row>
      <!-- 头部 -->
      <div class="header">
        <el-col :span="3" class="header-nav">
          <router-link to="/">首页&nbsp;&nbsp;/</router-link>
          <router-link to="/">营销&nbsp;&nbsp;/</router-link>
          <router-link to="/">促销详情</router-link>
        </el-col>
        <el-col :span="1" :offset="20" class="header-img">
          <!-- <img src="" alt=""> -->
        </el-col>
      </div>
    </el-row>
    <div class="contents">
      <el-row>
        <el-col :span="3">
          <input type="search" class="search" placeholder="请输入通知标题">
        </el-col>
        <el-col :span="2" :offset="19">
          <el-form>
            <router-link to="/marketingNoticeAdd">
              <div class="contents-add-plus">
                <img src="./../../../../static/images/marting-plus.png" width="15" height="15">
                <p style="padding-left:3px">新增</p>
              </div>
            </router-link>
          </el-form>
        </el-col>
      </el-row>
      <div style="background-color:#fff">
        <!--开始列表-->
        <el-row class="tableRow">
          <el-col :span="1">序号</el-col>
          <el-col :span="5" :offset="1">标题</el-col>
          <el-col :span="3">状态</el-col>
          <el-col :span="3" :offset="1">发送对象</el-col>
          <el-col :span="3" :offset="2">阅读数</el-col>
          <el-col :span="3" :offset="1">创建时间</el-col>
        </el-row>
        <div class="scroll">
          <el-row
            class="tableData"
            v-for="(site,key) in tableData"
            :key="key"
            @mouseover.native="changeMask(key)"
            @mouseout.native="changeOut()"
          >
            <el-col :span="1">{{++key}}</el-col>
            <el-col :span="5" :offset="1" class="tableData-td1">
              <router-link to="/marketingNoticeDetails">{{site.title}}</router-link>
            </el-col>
            <el-col :span="3" class="state">{{site.state}}</el-col>
            <el-col :span="3" :offset="1" class="objects">{{site.objects}}</el-col>
            <el-col :span="3" :offset="2" class="count">{{site.count}}</el-col>
            <el-col :span="2" :offset="1" class="time">{{site.time}}</el-col>
            <el-col class="hoverKuang" v-if="key == i" :style="{opacity:opacity}">
              <router-link to="/">发送</router-link>
              <router-link to="/marketingNoticeEdi">编辑</router-link>
              <router-link to="/">结束</router-link>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
    <!-- 引入公共组件分页 -->
  </div>
  </V-CommonHeaderLeft>
</div>
</template>

<script>
import VCommonHeaderLeft from '@/components/common/vCommonHeaderLeft/VCommonHeaderLeft'
export default {
  components: {
    VCommonHeaderLeft
  },
  name: 'marketingOrder',
  data () {
    return {
      hidden: 'hidden',
      opacity: 0,
      i: true,
      tableIndex: 0,
      form: {
        region: ''
      },
      value: '',
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      value1: '',
      value2: '',
      tableData: [{
        show: true,
        title: 'qwe',
        content1: '打折',
        content2: '【订单满20元享1折】',
        time: '2019.5.30~2019.6.30',
        objects: '普通代理商，金牌代理商',
        state: '促销中',
        count: 1
      },
      {
        show: true,
        title: 'u回到顶端开始交往i第九十八',
        content1: '直降',
        content2: '【订单满100元赠[示例商品]】',
        time: '2019.5.30~2019.6.30',
        objects: '普通代理商，金牌代理商',
        state: '促销中',
        count: 2
      }]
    }
  },
  methods: {
    changeMask (key) {
      this.opacity = 1
      this.i = key
    },
    changeOut () {
      this.opacity = 0
    }
  }
}
</script>

<style scoped lang="scss">
#app {
  width:100%;
  background-color: #f2f5f7;
  height: 100%;
  padding: 15px 10px 0px 10px;
  .header {
    height: 45px;
    .header-nav {
      line-height: 30px;
      font-size: 12px;
      display: flex;
      justify-content: space-around;
      padding-left: 10px;
      span {
        display: inline-block;
        margin-left: 10px;
      }
      a {
        color: #999999;
      }
      a:hover {
        color: #20ade5;
      }
    }
    .header-img {
      width: 25px;
      height: 25px;
      border-radius: 5px;
      border: 1px solid #dce4e7;
    }
  }
}
.header-nav a:last-child {
  color: #333 !important;
}
.header-nav a:last-child:hover {
  color: #333 !important;
}
.search {
  border: 1px solid #dcdfe6;
  width: 240px;
  height: 38px;
 margin:0px 0px 20px 0px;
  text-indent: 1em;
}
.contents /deep/ .el-row {
  padding: 15px 0px 0px 25px;
  background-color: #fff;
  font-size: 12px;
  .select-style /deep/ .el-input__inner {
    height: 37px;
    border-radius: 0;
    width: 130px;
    font-size: 12px;
  }
}
.contents-select-data {
  margin-top: 3px;
}
.contents-add-plus {
  display: flex;
  font-size: 15px;
  color: #20ade5;
  margin-top: 10px;
}
.elTable {
  height: 430px;
  border-top: 1px solid #e4e4e4;
  border-bottom: 1px solid #e4e4e4;
}
.elTable /deep/ th {
  height: 50px;
}
.elTable /deep/ .el-table td {
  padding: 0;
}
.scroll {
  overflow-x: hidden;
  overflow-y: scroll;
  height: 375px;
}
.tableRow {
  border-top: 1px solid #e3e3e3;
  border-bottom: 1px solid #e3e3e3;
  height: 50px;
  background-color: #fcfcfc !important;
  line-height: 30px;
}
.tableData {
  border-top: 0;
  border-bottom: 1px solid #e3e3e3;
  height: 40px;
  background-color: #fff !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 40px;
}
.tableData:hover {
  background-color: #f5f5f5 !important;
}
.tableData-td1 {
  padding-left: 3px;
}
.tableData-td1 a:hover {
  color:#20ade5 !important;
}
.tableData-td {
  display: flex;
  padding-left: 4px;
}
.tableData-td span:nth-child(1) {
  display: block;
  width: 38px;
  height: 18px;
  background-color: #ff3838;
  color: #fff;
  border-radius: 5px;
  text-align: center;
  line-height: 18px;
  margin-top: 10px;
  font-size: 12px;
}
.yu-time {
  padding-left: 6px;
}
.fa-time {
  padding-left: 8px;
}
.objects {
  padding-left: 7px;
}
.state {
  padding-left: 2px;
}
.count {
  padding-left: 10px;
}
.time {
  padding-left: 13px;
}
.hoverKuang {
  width: 190px;
  height: 40px;
  background-color: #a3bbd4;
  font-size: 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  right: 0px;
}
.hoverKuang a {
  color: #fcfdfd;
}
</style>
